<?php defined('_JEXEC') or die ; 
/**
 * @package pmapi
 * @copyright Copyright (c)2014 Enrico Fagnoni
 * @license GNU General Public License version 3, or later
 *
 * @since 1.0.0
 */
?>
<h1>Welcome to Linked Data APIs</h2>

<p>This section allow you to access shop data as five star Linked (open) Data.</p>
<p>Data are serialized as RDF according with the 
    <a href="http://ontology.it/profiles/platinummine/v1">Platinum Mine Language Profile</a> that is entirely
    based on public standard ontologies like goodrelations, foaf, void, dublin core and others.
</p>
<p>APIs to data publishing are provided as RESTful resources compliant with W3C Linked Data Platform Specifications (LDP). 
   APIs support LDP paging feature to allow you to publish very large datasets.</p>

<p>Please see <a href="<?=$this->datasetLicenseURL?>">Data license policy</a></p>

<h2>Dataset endpoints</h2>
<p><?=JText::_('PMAPI_DS_DESCRIPTION') ?> [ see as <a href="<?=UriHelper::mkDataURL() ?>">RDF</a> ]</p> 
<ul>
  <?php foreach( $this->items as $item => $desc): ?> 
    <li>
       <strong><?=$item ?></strong>: <?=JText::_($desc) ?> 
        [ <a href="<?=UriHelper::mkHtmlURL($item) ?>">HTML</a>, <a href="<?=UriHelper::mkDataURL($item) ?>">RDF</a> ]
    </li>
  <?php endforeach ?>
</ul>

<h2>How to access Linked Data</h2>
<p>
    APIs supports SEO friendly URLs and <a href="http://www.w3.org/TR/cooluris/">semantic web hash URIs</a>
    according with this template:
</p>
<pre>    
    <code><?=UriHelper::mkDataURL()?>[/<em>end point</em>[/<em>resource</em>[#<em>concept</em>]]]</code>
</pre>
<p>To consume linked data, just access the data resource uri with an http client. To manage large dataset
    (i.e. more than 1000 datadumps ) the client must support LDP paging protocol.</p>
<p>Turtle (text/turtle) is the default serialsing format. Other serialization available by http content negotiation:</p>
<ul>
    <li>ntriples (text/ntriples)</li>
    <li>rdfxml (application/rdf+xml)</li>
    <li>n3 (text/n3)</li>
    <li>json (application/rdf+json)</li>
</ul>
<p>You can force a serialisation format specifying layout=(turtle|rdfxml|n3|json) in URL.</p>
    
<h2>Data visibility</h2>
<p>
    Published Linked Data reflect the data visibility of the caller. That means that you are enabled 
    to see as Linked Data all you can see in the shop:
</p>
<ul>
    <li><strong>anonymus user</strong> will have access to all published product (with anonymous related prices), 
        all vendor and manufacturers info, all the ontology, no orders.</li>
    <li><strong>registered users</strong> will have access to all published product (with user specific prices), 
        all vendor and manufacturers info, all the ontology, all their orders.</li>
    <li><strong>shop administrators</strong>  will have access to all data.</li>
</ul>

<p>
    Anonymous users can increase data visibility signing in before requesting a resource.
</p>
<?php if ($this->basicAuthEnabled): ?>
<p>
    You can also login to your virtuemart account using http basic authentication protocol using a site credential
    In this case a logout will be forced after every requests. 
</p>

<p>Please note that http basic autentication is quite insicure on uncripted links.</p>
<?php endif ?>
